import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class RedisDemo {
    public static void main(String[] args) {
        //redis连接池
        JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");
        //从连接池中获取连接
        try(Jedis jedis = jedisPool.getResource()) {
            String ping = jedis.ping();
            System.out.println(ping);
        }
    }
}
